00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _DENETMSG_HPP
00029 #define _DENETMSG_HPP
00030
00031 #ifndef _DENET_HPP
00032 #include "deNet.hpp"
00033 #endif
00034
00035 class dePacket;
00036
00037 class DENET_API deNetMsg
00038 {
00039 public:
00040
00041 deNetMsg(void);
00042 deNetMsg( dePacket * pPacket );
00043 virtual ~deNetMsg(void);
00044
00045 enum eMsgID
00046 {
00047 MSG_INVALID_ID = (WORD)(-1),
00048
00049 MSG_LOW_LEVEL = 0,
00050 MSG_HANDSHAKE,
00051 MSG_DISCONNECT,
00052 MSG_PING,
00053
00054 MSG_HIGH_LEVEL,
00055 MSG_SERVER_TIME,
00056 MSG_CONNECTION_REQUEST,
00057 MSG_CONNECTION_REPLY,
00058 MSG_CONNECTION_LOST,
00059 MSG_CUSTOM,
00060 MSG_MAX_ID
00061 };
00062
00063 eNetError Init( dePacket * pPacket );
00064 hNetUser GetSender(void) const { return m_Sender; }
00065 hNetUser GetRecip(void) const { return m_Recip; }
00066 WORD GetMsgID(void) const { return m_iMsgID; }
00067 DWORD GetDataSize(void) const { return m_DataSize; }
00068 void * GetData(void) const { return m_Data; }
00069
00070 private:
00071
00072 hNetUser m_Sender;
00073 hNetUser m_Recip;
00074 WORD m_iMsgID;
00075 DWORD m_DataSize;
00076 BYTE * m_Data;
00077
00078 public:
00079
00080 deNetMsg& operator = ( const deNetMsg& r );
00081 };
00082
00083 #endif